// 聊天角色类型
export const ChatRoleTypes = {
    System: 'System', // 系统
    Self: 'Self', // 自己
    Others: 'Others', // 别人
} as const;

const chatBubbles = ['default', 'qiaokeli', 'saibopengke'];

// 遍历 chatBubbleClasses 数组
const getChatBubble = (chatBubbleName: string) => {
    for (const chatBubble of chatBubbles) {
        if (chatBubble === chatBubbleName) return chatBubble;
    }
    return 'default';
};

export const chatBubbleApi = {
    getName: (role: keyof typeof ChatRoleTypes, chatBubbleName: string) => {
        let chatBubbleName_ = '';
        switch (role) {
            case ChatRoleTypes.System:
                chatBubbleName_ = 'system';
                break;
            case ChatRoleTypes.Self:
                chatBubbleName_ = 'oneself';
                break;
            case ChatRoleTypes.Others:
                chatBubbleName_ = 'others';
                break;
            default:
                chatBubbleName_ = 'oneself';
        }
        return chatBubbleName_ + '_bubble_' + getChatBubble(chatBubbleName);
    },
    getList: () => {
        return chatBubbles;
    },
}